<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>订单列表页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta name="csrf-token" content="{{csrf_token()}}">
    @include('home.public.style')
    @include('home.public.script')
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5" method="get" action="{{url('home/branch/order')}}">
                        <div class="layui-inline layui-show-xs-inline">
                            <input type="text" name="orderno" style="width:250px" placeholder="请输入订单号(支持模糊查询)"
                                   value="{{$request->input('orderno')?$request->input('orderno'):""}}"
                                   autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-inline">
                            <input type="text" name="account" style="width:250px" placeholder="请输入用户名(支持模糊查询)"
                                   value="{{$request->input('account')?$request->input('account'):""}}"
                                   autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn" lay-submit="" lay-filter="sreach"><i
                                        class="layui-icon">&#xe615;</i></button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>id</th>
                            <th>充值账号</th>
                            <th>订单号</th>
                            <th>订单状态</th>
                            <th>创建时间</th>
                            <th>完成时间</th>
                            <th>购买数量</th>
                            <th>订单价格</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($order as $v)
                            <tr>
                                <td>{{$v->id}}</td>
                                <td>{{$v->chargeaccount}}</td>
                                <td>{{$v->orderno}}</td>
                                <td @if($v->status == "充值失败")style="color: red"@endif>{{$v->status}}</td>
                                <td>{{date("Y-m-d H:i:s",$v->buytime)}}</td>
                                <td>{{date("Y-m-d H:i:s",$v->time)}}</td>
                                <td>{{$v->num}}</td>
                                <td>{{$v->price}}</td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        {!! $order ->appends($request->all())->render() !!}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    function fresh_page(){
        window.location.reload();
    }

    setInterval('fresh_page()',5000);
</script>
</html>